package com.TheyChat.service.config.core.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public enum AgreeEnum implements BaseEnum{
    Agree(1, "同意"),
    Waiting(0, "待定"),
    Refuse(-1,"打回");
    @EnumValue
    private Integer value;
    @Getter
    private String desc;
    /**
     * 序列化
     *
     * @return 不允许返回 null
     */
    @Override
    public Integer getValue() {
        return this.value;
    }

    @JsonCreator
    public static AgreeEnum findYesNoEnum(Integer value){
        for (AgreeEnum item : AgreeEnum.values()) {
            if (item.getValue().equals(value)) {
                return item;
            }
        }
        return null;
    }
}
